/*
 * Graph.h
 *
 *  Created on: Sep 18, 2012
 *      Author: pedro
 */

#ifndef GRAPH_H_
#define GRAPH_H_

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include<ctime>

#include <mpi.h>

#include "Defines.h"
#include "Index.h"

#define MAX_WEIGHT 100
#define DASH 1000000

using namespace std;
using namespace MPI;

class Graph {

public:

	Graph();

	Graph(int );

	Graph(Graph &);

	Graph(const Graph &);

	Graph(string );

	virtual ~Graph();

	int operator ()(int i, int j) { return matrix[i][j]; }

	int operator ()(Index i) { return matrix[i.getX()][i.getY()]; }

	void operator ()(int i, int j, int value) { matrix[i][j] = value; }

	void operator ()(Index i, int value) {  matrix[i.getX()][i.getY()] = value; }

	int getSize();

	int** getMatrix();

	void generate();

	bool save(string );

	void print();

	void send(int );

	void receive(int );


private:

	int **matrix;
	int size;

};

#endif /* GRAPH_H_ */
